#ifndef __TASKQUEUE_H
#define __TASKQUEUE_H
#include <queue>
#include <mutex>
#include <condition_variable>

using namespace std;

class TaskQueue{
public:
    TaskQueue(size_t capacity);
    ~TaskQueue();

    void push(int value);
    int pop();

    bool full() const;
    bool empty() const;
private:
    size_t _capacity;
    queue<int> _que;
    mutex _mutex;
    condition_variable _notFull;
    condition_variable _notEmpty;
};


#endif

